home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 March
/
CMCD0305.ISO
/
Software
/
Shareware
/
Utilitare
/
emu
/
Emu8086_Setup_307c.exe
/
{app}
/
Samples
/
3_sample.asm
< prev
next >
Wrap
Assembly Source File
|
2002-08-02
|
447b
|
39 lines
#make_BIN#
; Calculate the sum
; of elements in V1 array,
; store result in V2.
; number of elements:
MOV CX, 5
; AL will store the sum:
MOV AL, 0
; BX is an index:
MOV BX, 0
; sum elements:
next: ADD AL, V1[BX]
; modify array for no
; specific reason:
MOV V1[BX], BL
; next byte:
INC BX
; loop until CX=0:
LOOP next
; store result in v2:
MOV V2, AL
HLT
; variables:
V1 DB 4, 3, 2, 1, 0
V2 DB 0